package com.qianying.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qianying.entity.SysPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SysPermissionMapper extends BaseMapper<SysPermission> {

    @Select("SELECT COUNT(1) FROM sys_permission WHERE url = #{url} AND http_method = #{method}")
    boolean exists(@Param("url") String url, @Param("method") String method);

    // 按className分组查询，返回分组后的映射关系
    List<Map<String, Object>> selectGroupByClassName();
}
